// const LOCAL_URL = 'http://124.71.81.168:2105/v1/' //对应接口路径
const LOCAL_URL = 'http://192.168.18.186:2108/v1/'
let require = function(obj) {
	return new Promise((resolve,reject)=>{
		uni.request({
			url:LOCAL_URL + obj.url,
			method:obj.method || 'GET',
			data:obj.data || {},
			success:(res)=>{		
				if(res.statusCode !== 200){
					return uni.showToast({
						title:'获取数据失败'
					})
				}
				resolve(res)
			},
			fail:(err)=>{
				uni.showToast({
					title:'请求接口失败'
				})
				reject(err)
			}
		})
	})
}

export {
	require //请求接口
}
